Skip to content

Merge parameter data to preserve description in manually edited Openapi spec - #149

Merged
exoego merged 1 commit into
exoego:masterfrom
mercedesb:dont-overwrite-parameter-descriptions
Dec 1, 2023
Merged

Merge parameter data to preserve description in manually edited Openapi spec#149
exoego merged 1 commit into
exoego:masterfrom
mercedesb:dont-overwrite-parameter-descriptions

Conversation

@mercedesb

@mercedesb mercedesb commented Nov 30, 2023

Copy link
Copy Markdown
Contributor

Resolves #144

In the issue comment, I saw that we expect to be able to add/edit parameter descriptions and have them be preserved.

From my testing, it looks like that's not happening.

This is a small change that should keep the unique behavior on parameter name and in while preserving description if someone manually added it to the generated properties.

@mercedesb
mercedesb force-pushed the dont-overwrite-parameter-descriptions branch from 5cd3059 to b83022e Compare November 30, 2023 22:10
@codecov

codecov Bot commented Nov 30, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b95658c) 96.68% compared to head (8e40280) 96.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
+ Coverage   96.68%   96.73%   +0.05%     
==========================================
  Files          14       14              
  Lines         422      429       +7     
  Branches       94       95       +1     
==========================================
+ Hits          408      415       +7     
  Misses         14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mercedesb
mercedesb force-pushed the dont-overwrite-parameter-descriptions branch from b123eba to 8e40280 Compare November 30, 2023 22:41
@mercedesb mercedesb changed the title merge parameter data to preserve description in openapi spec Merge parameter data to preserve description in manually edited Openapi spec Nov 30, 2023
@exoego exoego added the bug Something isn't working label Dec 1, 2023

@exoego exoego left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

IIUC, this PR is a bugfix.
The previous implementation fails to preserve manually-added properties (description for this case).
I confirmed that description is gone without your fix.
Nice catch.

@exoego
exoego merged commit 7804e0f into exoego:master Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include property descriptions in response schema?

2 participants